﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using xvnet.API;

namespace cbmobile
{
    public partial class TImKiem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected override void CreateChildControls()
        {
            //try
            //{      

            string controlPath = "/MasterUser/UC_Page/" + "/" + LoadPage;
            Control control = LoadControl(controlPath);
            control.EnableViewState = true;
            Panel_Modules.Controls.Add(control);
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, true);
            //}
        }


        private string LoadPage
        {
            get
            {
                if (Request.QueryString["muid"] != null)
                {
                    string muid = Request.QueryString["muid"].ToString();
                    return PageInfo(muid);
                }
                return string.Empty;
            }

        }

        public string PageInfo(string p_key)
        {
            string ret = string.Empty;
            string modulePath = Request.QueryString["smid"];
            ModulePageInfo modulePageInfo = ModulePageInfo.PageInfoLoad(modulePath);
            foreach (PageInfo p in modulePageInfo.pageInfos)
            {
                if (p.key == p_key)
                {
                    ret = p.pageName;
                    break;
                }
            }
            return ret;
        }
    }
}